# -*- coding: utf-8 -*-


def dual_ammount(ammount):
    if ammount[-1] == '亿':
        final_ammount = int(float(ammount[:-1]) * 100000000)
    elif ammount[-1] == '万':
        final_ammount = int(float(ammount[:-1]) * 10000)
    else:
        final_ammount = int(ammount)
    return final_ammount


def dualdate( a):
    if len(a.strip()) < 10:

        month = '0' + a.split('-')[1]
        pata = a.split('-')
        pata[1] = month
        final = '-'.join(pata)
        return (final)
    elif len(a.strip()) > 16:
        if len(a.strip())<18:
            month = '0' + a.split('/')[1]

            pata = a.split('/')
            pata[1] = month
            final = '-'.join(pata)
            return final[:10]
        else:
            month =a.split('/')[1]
            pata = a.split('/')
            pata[1] = month
            final = '-'.join(pata)
            return final[:10]
    else:
        return a


def dualdateb(a):
    pata=a.split('-')
    month=a.split('-')[1]
    if month[0]=='0':
        month=month[1]
    else:
        month=month

    pata[1]=month

    final='/'.join(pata)+' 0:00:00'
    return final


def dualcode(a):
    if a[0]=='6':
        a=a+'.SH'
    else:
        a=a+'.SZ'

    return a

def dualbasicdate(a):
    return a.replace('-','')

def dualbasicamount(a):
    return a*10000